import java.util.*;
public class ExceptionTest1 {
    public static void main(String[] args) {
        Scanner in = new Scanner(System.in);
        try {
            System.out.print("请输入被除数：");
            double beichushu =in.nextDouble();
            System.out.print("请输入除数：");
            double chushu = in.nextDouble();;
            if (beichushu==0)
                throw new ArithmeticException("请输入不为0的数字！");
            double i = (beichushu / chushu);
            System.out.println("二者的商为：" + i);
        } catch (InputMismatchException e1) {
            System.out.println("请输入数字！");
        } catch (ArithmeticException e2) {
            System.out.println("请输入不为0的数字！");
        } finally {
            System.out.print("谢谢");
        }
    }
}

